﻿@model IEnumerable<mvc_diary_content.Models.Diary>

@{
    ViewData["Title"] = "Diary";
}


<form asp-controller="Diary" asp-action="Index" method="get">
       <p>
           按标题搜索：<input type="text" name="searchTitle"/>
           <input type="submit" value="搜索"/>
       </p>
</form>
<h1>日志</h1>


<div class="table">

    @foreach (var item in Model)
    {
        <p>
            @Html.DisplayFor(modelItem => item.Title)

        </p>
        <p>
            @Html.DisplayFor(modelItem => item.Content)
        </p>
        <p>
            发布：<span>@Html.DisplayFor(modelItem => item.CreateDate)</span> |
            阅读：<span>@Html.DisplayFor(modelItem => item.Read)</span>
        </p>
        <p>
            <a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
            <a asp-action="Details" asp-route-id="@item.Id">Details</a> |
            <a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
        </p>
    }
</div>

<p>
    <a asp-action="Create">Create New</a>
</p>
